#ifndef __MESSAGE_HANDLER_H__
#define __MESSAGE_HANDLER_H__

#include "json/rapidjson.h"
#include "json/document.h"
#include "json/stringbuffer.h"
#include "json/writer.h"


#include "manager/MessageQueue.h"
#include "message/BaseMessage.h"
#include "message/ForestAnimalMessage.h"
#include "message/ForestCoinMessage.h"
#include "message/ForestTreeMessage.h"
#include "message/MushroomMessage.h"
#include "message/StartMessage.h"
#include "message/BaseXiyouMessage.h"
#include "message/HitMonsterMessage.h"
#include "message/SocketControlMessage.h"
#include "message/SpecialBubbleMessage.h"
#include "message/HomeTLGMessage.h"
#include "message/ForestTLGMessage.h"
#include "SpecialDeviceControlHandler.h"
#include "message/TimeoutMessage.h"
using namespace rapidjson;

typedef std::function<BaseMessage(Document* doc)> CreateMessageFunc;

class MessageHandler
{
public:
	MessageHandler();
	~MessageHandler();

	void handle(Document* doc);

	/*ForestTreeMessage* createForestTreeMessage(Document* doc);

	ForestAnimalMessage* createForestAnimalMessage(Document* doc);

	ForestCoinMessage* createForestCoinMessage(Document* doc);*/

	MushroomMessage* createMushroomMessage(Document* doc);

	StartMessage* createStartMessage(Document* doc);

	/*BaseXiyouMessage* createBaseXiyouMessage(Document* doc);

	HitMonsterMessage* createHitMonsterMessage(Document* doc);

	SpecialBubbleMessage* createSpecialBubbleMessage(Document* doc);

	HomeTLGMessage* createHomeTLGMessage(Document* doc);

	ForestTLGMessage* createForestTLGMessage(Document* doc);

	TimeoutMessage* createTimeoutMessage(Document* doc);*/

private:
	SpecialDeviceControlHandler* m_pSpecialDeviceControlHandler;
};
#endif //__MESSAGE_HANDLER_H__